<?php

App::uses("ValuesBuildFactory", "Lib/Chart");

class ChartManager {

	private $chart = null;
	
	public function __construct($chart) {
		$this->chart=$chart;
	}

	public function getDatasource() {
		$data = array();
		// pr($this->chart);die;
		foreach ($this->chart["Serie"] as $key => $serie) {
			$vbf = new ValuesBuildFactory($serie);
			$valuesBuild = $vbf->getValuesInstance();
			$valuesBuild->build();
			array_push($data,$valuesBuild->getData());
		}
		// pr($data);
		// return array(array("3","8","4","10"),array("5","7","6","9"));
		return $data;
	}

}
?>